#!/usr/bin/env python
"""
NOT IMPLEMENTED

NOT IMPLEMENTED

NOT IMPLEMENTED
"""
import pygame

bindings = {}

def bind(event, function, arguments):
    try:
        bindings[event].append((function, arguments))
    except KeyError:
        bindings[event] = [(function, arguments)]

def unbind(event, function, arguments=None):
    try:
        for binding in bindings[event]:
            if binding[0] == function and arguments and binding[1] == arguments:
                bindings[event].remove(binding)
    except KeyError:
        print event, "not bound yet"
    except IndexError:
        print "event trawble!!111"
    except ValueError:
        print "just how many things can go wrong here!?"

def handle():
    events = pygame.event.get()
    for event in events:
        if event.type == pygame.QUIT:
            return False
        if event.type == pygame.KEYDOWN:
            if event.key == pygame.K_LEFT:
                menu.selectItem(menu.selectedItemNumber + 1)
            if event.key == pygame.K_RIGHT:
                menu.selectItem(menu.selectedItemNumber - 1)